package com.cloudcc.mobile.util;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;

import com.cloudcc.mobile.dialog.RelevantDialog;

public class RevlevantDialogUtils {
	public static int a = 0, b = 0, c = 0;

	public static void isFirstDialog(Context context) {
		try {
			final RelevantDialog relevant = new RelevantDialog(context);
			final Dialog leixingdialog = relevant.creatLeiXingDialog();
			relevant.onleixingClickListener(new OnClickListener() {
				@Override
				public void onClick(View v) {
					RevlevantDialogUtils.a++;
					leixingdialog.dismiss();
					final Dialog huadongdialog = relevant.createHuDongDialog();
					relevant.onhuadongClicListner(new OnClickListener() {
						@Override
						public void onClick(View v) {
							RevlevantDialogUtils.b++;
							huadongdialog.dismiss();
						}
					});
					if (b == 0) {
						huadongdialog.show();
					}
				}
			});
			if (a == 0) {
				leixingdialog.show();
			}
		} catch (Exception e) {
			Tools.handle(e);
		}
	}

}
